<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<meta content="telephone=no,email=no,address=no" name="format-detection" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
		<meta name="msapplication-tap-highlight" content="no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<meta name="is_webp" content="yes" />
		<title>我的代言</title>
		<meta name="Keywords" content="用户中心" />
		<meta name="Description" content="用户中心" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1" />
		<meta name="format-detection" content="telephone=no">
		<link rel="stylesheet" href="__TMPL__Public/css/common.css" />
		<link rel="stylesheet" href="__TMPL__Public/css/user.css" />
		<link rel="stylesheet" href="__TMPL__Public/css/public.css" />
		<style>
			.detail-main table{width: 100%;border: none;}
			.detail-main table tr{overflow: hidden;border-bottom: 1px solid #ddd;float: left;width: 100%;background: #FFFFFF;}
			.detail-main table tr td{float: left;width: 100%;}
			.detail-main table tr td:first-child img{max-width: 44px;height: auto;}
			.ns-rg-time{font-size: 14px;float: right;margin-right: 10px;}
			.detail-main table tr td:last-child{width: 100%;}
			.detail-main table tr td:last-child p{line-height: 22px;margin-bottom: 0px;width: 100%;font-size: 16px;}
			.detail-main table tr td:last-child .title{float: left;color: #2d2d2d;font-size: 14px;}
			.detail-main table tr td:last-child .money{float: right;font-size: 14px;color: #FF7C56;}
			.detail-main table tr td:last-child .money.fu{color: #999;}
			.detail-main table tr td:last-child .date{color: #909090;font-size: 12px;}
			.detail-main table tr td:last-child p:last-child{float: left;color: #666666;font-size: 12px;}
			.ns-lf{float: left;margin-left: 55px;}
			.ns-rg{color: red;font-size: 14px;float: right;margin-right: 10px;}
			.account-box{border-top: 1px solid #f77c52;background: -webkit-linear-gradient(#FE4445, #FF8458);background: -o-linear-gradient(#FE4445, #FF8458);background: -moz-linear-gradient(#FE4445, #FF8458);background: linear-gradient(#FE4445, #FF8458);padding: 50px 0 35px 0px;text-align: center;}
			.account-box .balace{font-size: 42px;color: #fff;margin: 7px 0 11px 0;}
			.detail-main2{display: none;}
			.zq_button{font-size: 12px;float: right;background: red;height: 20px;line-height: 20px;color: #fff;padding: 3px 7px;border-radius: 3px;margin-top: -7px;}
			.rec_li{ float: left;width: 50%;text-align: center;height: 35px;line-height: 35px;background:#eee;}
			.rec_hover{background:#fff;}
			#tablelist_append_lp{display: none;}
   		</style>
				<link rel="stylesheet" href="/themes/wnsc_moblie/newMobile/User/css/bonus.css" />
						<link rel="stylesheet" href="/themes/wnsc_moblie/Public/css/collect.css" />

	</head>

	<body>

		<div>
			<?php
				$agent = $_SERVER['HTTP_USER_AGENT'];
				if(strpos($agent,"Html5Plus") === false){
			?>
			<header>
				<div class="header">
					<div class="header-left">
						<a class="sb-back" href="{:U('user/center')}" title="返回"></a>
					</div>
					<div class="header-middle">我的代言</div>
					<div class="header-right">
						<aside class="show-menu-btn">
							<div id="show_more" class="show-menu">
								<a href="javascript:;"></a>
							</div>
						</aside>
					</div>
				</div>
			</header>
			<mtc_include file="Public:right_nav" />
			<?php
			}
			?>
			<style type="text/css">
				.form-group dt {
					width: 110px!important;
					text-align: right;
				}
			</style>
			<div class="wrapper02" id="nav_list">
			<div class="scroller" style="width: 100%;background: #fff;">
				<ul class="clearfix" style="width: 100%;">
					<li data="0" style="width: 50%;" class="cur">
						<a href="javascript:void(0)" id='order_all'>代言的产品</a>
					</li>
					<li data="1" style="width: 50%;">
						<a href="javascript:void(0)" id='order_unpayed'>代言的奖励</a>
					</li>
				</ul>
			</div>
		</div>
		<div class="middle-content recharge-card m-t-0 info detail-main1" >

			
			<li class="noResultTipTmall"><img class="logo" src="/themes/wnsc_moblie/Public/images/bg_empty_list.png" alt="快抢我">
					<div class="title">您还没有可代言的产品</div>
					<ul>
						<li>购买代言产品，确认收货后即可代言产品</li>
					</ul>
				</li>
		</div>
		<div class="middle-content recharge-card m-t-0 info detail-main2" >
			<div class="account-box">
				<p class="balace">{:number_format($daiyan_price,2)}</p>
				<p style="font-size: 14px;color: #ffc9b6;padding-bottom: 15px;">我的红包(元)</p>
			</div>
			<div>
				<ul>
					<li class="rec_li rec_hover" data="1">红包</li>
					<li class="rec_li" data="2">礼品</li>
				</ul>
			</div>
			<div id="tablelist_append_hb"></div>
			<div id="tablelist_append_lp"></div>
		</div>
		</div>

		</span>

		</div>

		</form>
		</div>
		<!-- 底部 _end	-->
		<section class="mask-div"></section>
		<script type="text/javascript" src="/themes/wnsc_moblie/newMobile/User/js/area/jquery.min.js"></script>
		<script type="text/javascript" src="__TMPL__Public/js/common.js"></script>
		<link rel="stylesheet" href="/themes/wnsc_moblie/Public/layui/css/layui.css">
		<script src="/themes/wnsc_moblie/Public/layui/layui.js"></script>

		<script type="text/javascript">
			$(function() {
				ajax_getdaiyan_product();
				$('.clearfix li').click(function() {
					$('.clearfix li').removeClass('cur');
					$(this).addClass('cur');
					$key = $(this).attr('data');
					if($key == 0) {
						$('.detail-main1').show();
						$('.detail-main2').hide();
						$('body').css('background','#fff')
						ajax_getdaiyan_product();
					}
					if($key == 1) {
						$('.detail-main2').show();
						$('.detail-main1').hide();
						$('body').css('background','#fff')
						ajax_getdaiyan_product_list();
					}
				})
				$('.rec_li').click(function() {
					$(this).siblings().removeClass('rec_hover');
					$(this).addClass('rec_hover');
					var kk=$(this).attr('data');
					if(kk==1){
						$('#tablelist_append_lp').hide();
						$('#tablelist_append_hb').show();
						ajax_getdaiyan_product_list();
					}
					if(kk==2){
						$('#tablelist_append_lp').show();
						$('#tablelist_append_hb').hide();
						ajax_getdaiyan_product_list2();
					}
					
				})
				
				

			})

			function ajax_getdaiyan_product() {
				var url = "{:U('user/ajax_getdaiyan_product')}";
				var amount = 6;
				layui.use('flow', function() {
					var $ = layui.jquery; //不用额外加载jQuery，flow模块本身是有依赖jQuery的，直接用即可。
					var flow = layui.flow;
					flow.load({
						elem: '.detail-main1', //指定列表容器
						done: function(page, next) { //到达临界点（默认滚动触发），触发下一页
							var lis = [];
							$.ajax({
								type: 'post',
								url: url,
								data: {
									page: page,
									amount: amount
								},
								dataType: 'json',
								success: function(res) {
									if(page == 1 && res.content == '') {
										$('.detail-main1 .noResultTipTmall').show();
										next(lis.join(''), page < res.pages);
										$('.layui-flow-more').hide();
									} else {
										$('.detail-main1.noResultTipTmall').remove();
										lis.push(res.content)
										next(lis.join(''), page < res.pages);
									}

								}
							});

						}
					});
				});
			}

			function ajax_getdaiyan_product_list() {
				var url = "{:U('user/get_daiyan')}";
				var amount = 6;
				layui.use('flow', function() {
					var $ = layui.jquery; //不用额外加载jQuery，flow模块本身是有依赖jQuery的，直接用即可。
					var flow = layui.flow;
					flow.load({
						elem: '#tablelist_append_hb', //指定列表容器
						done: function(page, next) { //到达临界点（默认滚动触发），触发下一页
							var lis = [];
							$.ajax({
								type: 'post',
								url: url,
								data: {
									page: page,
									amount: amount
								},
								dataType: 'json',
								success: function(res) {
									if(page == 1 && res.content == '') {
										$('.com_content2 .noResultTipTmall').show();
										next(lis.join(''), page < res.pages);
										$('.layui-flow-more').hide();
									} else {
										$('.com_content2 .noResultTipTmall').remove();
										lis.push(res.content)
										next(lis.join(''), page < res.pages);
									}

								}
							});

						}
					});
				});
			}
			
			function ajax_getdaiyan_product_list2() {
				var url = "{:U('user/get_daiyan2')}";
				var amount = 6;
				layui.use('flow', function() {
					var $ = layui.jquery; //不用额外加载jQuery，flow模块本身是有依赖jQuery的，直接用即可。
					var flow = layui.flow;
					flow.load({
						elem: '#tablelist_append_lp', //指定列表容器
						done: function(page, next) { //到达临界点（默认滚动触发），触发下一页
							var lis = [];
							$.ajax({
								type: 'post',
								url: url,
								data: {
									page: page,
									amount: amount
								},
								dataType: 'json',
								success: function(res) {
									if(page == 1 && res.content == '') {
										$('.com_content2 .noResultTipTmall').show();
										next(lis.join(''), page < res.pages);
										$('.layui-flow-more').hide();
									} else {
										$('.com_content2 .noResultTipTmall').remove();
										lis.push(res.content)
										next(lis.join(''), page < res.pages);
									}

								}
							});

						}
					});
				});
			}
		</script>


		

	</body>

</html>